package 完全二叉树的权值;

import java.util.Scanner;

public class Main {
    static int N = 100010;
    static long[] a = new long[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 1; i <= n; i++) {
            a[i] = in.nextLong();
        }
        long maxs = Long.MIN_VALUE;
        int depth = 0;
        for (int d = 1, i = 1; i <= n; i *= 2, d++) {
            long s = 0;
            for (int j = i; j < i + (1 << d - 1) && j <= n; j++) {
                s += a[j];
            }
            if (s > maxs) {
                maxs = s;
                depth = d;
            }
        }
        System.out.println(depth);
    }
}
